﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CluelessGame
{
    [Serializable]
    public class GameObjects
    {
        public int ActivePlayerCount = 1;

        public Dictionary<Player, List<Card>> Hands;
        public CrimeCards CurrentCrimeCards;

        public Room Ballroom;
        public Room Billiardroom;
        public Room Conservatory;
        public Room Diningroom;
        public Room Hall;
        public Room Kitchen;
        public Room Library;
        public Room Lounge;
        public Room Study;

        public Weapon Knife;
        public Weapon Candlestick;
        public Weapon Wrench;
        public Weapon Rope;
        public Weapon Revolver;
        public Weapon Pipe;

        public Character MrGreen;
        public Character MsPeakcock;
        public Character MsWhite;
        public Character ColonelMustard;
        public Character MissScarlet;
        public Character ProfessorPlum;

        public GameObjects()
        {
            Knife = new Weapon();
            Knife.Name = "Knife";
            Candlestick = new Weapon();
            Candlestick.Name = "Candlestick";
            Wrench = new Weapon();
            Wrench.Name = "Wrench";
            Rope = new Weapon();
            Rope.Name = "Rope";
            Revolver = new Weapon();
            Revolver.Name = "Revolver";
            Pipe = new Weapon();
            Pipe.Name = "Pipe";

            MrGreen = new Character();
            MrGreen.Name = "MrGreen";
            MsPeakcock = new Character();
            MsPeakcock.Name = "MsPeakcock";
            MsWhite = new Character();
            MsWhite.Name = "MsWhite";
            ColonelMustard = new Character();
            ColonelMustard.Name = "ColonelMustard";
            MissScarlet = new Character();
            MissScarlet.Name = "MissScarlet";
            ProfessorPlum = new Character();
            ProfessorPlum.Name = "ProfessorPlum";

            Ballroom = new Room();
            Ballroom.Name = "Ballroom";
            Billiardroom = new Room();
            Billiardroom.Name = "Billiardroom";
            Conservatory = new Room();
            Conservatory.Name = "Conservatory";
            Diningroom = new Room();
            Diningroom.Name = "Diningroom";
            Hall = new Room();
            Hall.Name = "Hall";
            Kitchen = new Room();
            Kitchen.Name = "Kitchen";
            Library = new Room();
            Library.Name = "Library";
            Lounge = new Room();
            Lounge.Name = "Lounge";
            Study = new Room();
            Study.Name = "Study";

            Hallway hallway = new Hallway();
            hallway.AdjacentRooms.Add(Study);
            hallway.AdjacentRooms.Add(Hall);
            Study.AdjacentHallways.Add(hallway);
            Hall.AdjacentHallways.Add(hallway);

            hallway = new Hallway();
            hallway.AdjacentRooms.Add(Hall);
            hallway.AdjacentRooms.Add(Lounge);
            Hall.AdjacentHallways.Add(hallway);
            Lounge.AdjacentHallways.Add(hallway);

            MissScarlet.CurrentLocation = hallway;
            hallway.Occupants.Add(MissScarlet);


            hallway = new Hallway();
            hallway.AdjacentRooms.Add(Study);
            hallway.AdjacentRooms.Add(Library);
            Study.AdjacentHallways.Add(hallway);
            Library.AdjacentHallways.Add(hallway);

            ProfessorPlum.CurrentLocation = hallway;
            hallway.Occupants.Add(ProfessorPlum);

            hallway = new Hallway();
            hallway.AdjacentRooms.Add(Hall);
            hallway.AdjacentRooms.Add(Billiardroom);
            Hall.AdjacentHallways.Add(hallway);
            Billiardroom.AdjacentHallways.Add(hallway);

            hallway = new Hallway();
            hallway.AdjacentRooms.Add(Lounge);
            hallway.AdjacentRooms.Add(Diningroom);
            Lounge.AdjacentHallways.Add(hallway);
            Diningroom.AdjacentHallways.Add(hallway);

            ColonelMustard.CurrentLocation = hallway;
            hallway.Occupants.Add(ColonelMustard);

            hallway = new Hallway();
            hallway.AdjacentRooms.Add(Library);
            hallway.AdjacentRooms.Add(Billiardroom);
            Library.AdjacentHallways.Add(hallway);
            Billiardroom.AdjacentHallways.Add(hallway);

            hallway = new Hallway();
            hallway.AdjacentRooms.Add(Billiardroom);
            hallway.AdjacentRooms.Add(Diningroom);
            Billiardroom.AdjacentHallways.Add(hallway);
            Diningroom.AdjacentHallways.Add(hallway);

            hallway = new Hallway();
            hallway.AdjacentRooms.Add(Library);
            hallway.AdjacentRooms.Add(Conservatory);
            Library.AdjacentHallways.Add(hallway);
            Conservatory.AdjacentHallways.Add(hallway);

            MsPeakcock.CurrentLocation = hallway;
            hallway.Occupants.Add(MsPeakcock);

            hallway = new Hallway();
            hallway.AdjacentRooms.Add(Billiardroom);
            hallway.AdjacentRooms.Add(Ballroom);
            Billiardroom.AdjacentHallways.Add(hallway);
            Ballroom.AdjacentHallways.Add(hallway);

            hallway = new Hallway();
            hallway.AdjacentRooms.Add(Diningroom);
            hallway.AdjacentRooms.Add(Kitchen);
            Diningroom.AdjacentHallways.Add(hallway);
            Kitchen.AdjacentHallways.Add(hallway);

            hallway = new Hallway();
            hallway.AdjacentRooms.Add(Conservatory);
            hallway.AdjacentRooms.Add(Ballroom);
            Conservatory.AdjacentHallways.Add(hallway);
            Ballroom.AdjacentHallways.Add(hallway);

            MrGreen.CurrentLocation = hallway;
            hallway.Occupants.Add(MrGreen);

            hallway = new Hallway();
            hallway.AdjacentRooms.Add(Ballroom);
            hallway.AdjacentRooms.Add(Kitchen);
            Ballroom.AdjacentHallways.Add(hallway);
            Kitchen.AdjacentHallways.Add(hallway);

            MsWhite.CurrentLocation = hallway;
            hallway.Occupants.Add(MsWhite);

            Lounge.SecretPassageConnectedRoom = Conservatory;
            Conservatory.SecretPassageConnectedRoom = Lounge;

            Study.SecretPassageConnectedRoom = Kitchen;
            Kitchen.SecretPassageConnectedRoom = Study;

            Study.Weapons.Add(Candlestick);
            Candlestick.CurrentLocation = Study;
            Kitchen.Weapons.Add(Knife);
            Knife.CurrentLocation = Kitchen;
            Lounge.Weapons.Add(Pipe);
            Pipe.CurrentLocation = Lounge;
            Hall.Weapons.Add(Revolver);
            Revolver.CurrentLocation = Hall;
            Ballroom.Weapons.Add(Rope);
            Rope.CurrentLocation = Ballroom;
            Conservatory.Weapons.Add(Wrench);
            Wrench.CurrentLocation = Conservatory;

        }
    }
}
